#ifndef MYWIDGET_H
#define MYWIDGET_H

#include <QLabel>
#include <QMouseEvent>
#include <QSvgGenerator>
#include <QColor>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QObject>
#include <QGraphicsItem>
#include <QGraphicsWidget>
#include <QGraphicsSceneMouseEvent>
#include <QWidget>
#include <QGraphicsWidget>
#include "cshape.h"

class SvgBezierItem :  public CShape
{

public:
    //构造函数
    SvgBezierItem (QPointF start, QPointF end, int Width = 1, QColor color = "black", QBrush brush_input = Qt::NoBrush);
    SvgBezierItem (qreal start_x,qreal start_y, qreal end_x, qreal end_y,int Width = 1, QColor color = "black", QBrush brush_input = Qt::NoBrush);
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override; //绘制曲线
    QRectF boundingRect() const override;
    QPainterPath shape() const override;
protected:
     void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
     void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
     void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
};

#endif // MYWIDGET_H

